To build Pytorch-Correlation-extension it is necessary to have an installation of Microsoft Visual Studio.
I installed the version 2019. This software is necessary to compile the code.


First is necessary to update the NVDIA Driver to version 572.70 or above

Link: https://uk.download.nvidia.com/Windows/572.70/572.70-desktop-win10-win11-64bit-international-dch-whql.exe

Then is necessary to install first the NVDIA SDK

I installed NVIDIA CUDA v12.8: cuda_12.8.0_571.96_windows.exe

Link: https://developer.download.nvidia.com/compute/cuda/12.8.0/local_installers/cuda_12.8.0_571.96_windows.exe

Then is necessary to install cuDNN, I installed the version v.8.9.7.29: cudnn-windows-x86_64-8.9.7.29_cuda12-archive.zip 

Link: https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-9.7.1.26_cuda12-archive.zip

This is a zip archive that need to be extracted in the same folder of CUDA SDK.
The directories to extract are: lib, include and bin.
For example in my PC I extracted the cudnn directories above in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8.
in this way all the cudnn dlls are stored in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\bin.

After the installation you should end-up having the following environment variables defined:

CUDA_MODULE_LOADING=LAZY
CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8
CUDA_PATH_V12_8=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8
TORCH_CUDA_ARCH_LIST=8.0 8.6 9.0 12.0
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\

If not you have to define them.

Then is necessary create a working folder, for example: colormnet

Next is necessary to create an environment.
I'm using conda, so the commands are the following:

create a working folder, for example: colormnet

conda create -n colormnet python=3.12
conda activate colormnet
cd colormnet
# you can install the desired version by changing the command below
conda install pytorch torchvision torchaudio pytorch-cuda=12.4 -c pytorch -c nvidia
After having installed the pytorch stuff, is necessary to override the conda environment 
(the location is displayed with the command 'conda list') with exactly the same pytorch 
packages installed in Hybrid, this will guarantee the maximum compatibility.
# install Pytorch-Correlation-extension
git clone https://github.com/ClementPinard/Pytorch-Correlation-extension.git 
cd Pytorch-Correlation-extension
python setup.py install

This will produce under the directory dist a egg file, like
spatial_correlation_sampler-0.5.0-py3.12-win-amd64.egg

This file have to be converted in wheel with the command (the script wheel to be installed with conda/pip)

wheel convert spatial_correlation_sampler-0.5.0-py3.12-win-amd64.egg

then is necessary to rename the generated file

spatial_correlation_sampler-0.5.0-py3.12-win-amd64.whl

in spatial_correlation_sampler-0.5.0-py3.12-win-amd64.whl.zip

so that is possible to open the zip archive.

The files need to be extracted in the directory (no way to install it with pip)

.\Hybrid\64bit\Vapoursynth\Lib\site-packages

